﻿@model LoginModel
@using SpotsHub.Gateway.Models.Customer;
@using Nop.Core;
@using Nop.Core.Infrastructure;
@using Nop.Core.Infrastructure.DependencyManagement;
@{
    Layout = null;
    ViewBag.Title = T("PageTitle.Login").Text;
    // +string+
    
    //register URL with return URL (if specified)
    var registerUrl = Url.RouteUrl("Register");
    if (!String.IsNullOrEmpty(this.Context.Request.QueryString["returnUrl"]))
    {
        var webHelper = EngineContext.Current.Resolve<IWebHelper>();
        registerUrl = webHelper.ModifyQueryString(registerUrl, "returnurl=" + HttpUtility.UrlEncode(this.Context.Request.QueryString["returnUrl"]), null);
    }
}
<div class="page login-page window">
    <div class="page-title window-title grad-lightgrey grad">
        <div class="window-title-bar  grad-titleshine grad">
            <img src="/Content/images/spotsexpress-logo-small.png" />
        </div>
    </div>

    <div class="page-body window-content space">
        @{
            // +string+
        }
        <p>Become a member with SpotsEXPRESS today and start your saving right away!</p>

        <a href="@registerUrl" class="button-grey">@T("Account.Register")</a>

            @using (Html.BeginForm("Login", "Customer", new { area = "Logistics"}))
            {
                @Html.ValidationSummary(true, T("Account.Login.Unsuccessful").Text)
                if (Model.UsernamesEnabled)
                {
                <div class="login-username">
                    @Html.LabelFor(m => m.Username)
                    @Html.TextBoxFor(m => m.Username, new { @class = "username", autofocus = "autofocus" })
                    @Html.ValidationMessageFor(m => m.Username)
                </div>
                }
                else
                {
                <div class="login-username">
                    @Html.TextBoxFor(m => m.Email, new { @class = "email", autofocus = "autofocus" })
                    @Html.ValidationMessageFor(m => m.Email)
                </div>
                }
            <div class="login-password">
            @Html.LabelFor(m => m.Password)
            @Html.PasswordFor(m => m.Password, new { @class = "password" })
            @Html.ValidationMessageFor(m => m.Password)
            </div>
            <div class="login-forgot">
                @Html.RouteLink(T("Account.Login.ForgotPassword").Text, "LogisticsPasswordRecovery")
            </div>
                if (Model.DisplayCaptcha)
                {
                @Html.Raw(Html.GenerateCaptcha())
                }
            <input class="button-grey login-button" type="submit" value="@T("Account.Login.LoginButton")" />
            <div class="login-remember">
                @Html.CheckBoxFor(m => m.RememberMe)
                @Html.LabelFor(m => m.RememberMe)
            </div>
            }

    </div>
</div>
